package cn._51doit.flink.day01.sources;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * Source是用来指定以后从哪里读取数据的
 *
 * readTextFile返回的DataStream是一个有限的数据流，数据处理完后，程序退出
 *
 */
public class FileSource1 {

    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        //调用Source方法创建DataStream
        DataStreamSource<String> lines = env.readTextFile("/Users/start/Desktop/a.txt");

        lines.print();

        env.execute();


    }
}
